/*
 * Copyright (C) 2012 by Hao Hou<ghost89413@gmail.com>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>*
 */


#ifndef __EVENT_H__
#define __EVENT_H__
#include <X11/Xlib.h>
#include <IMdkit.h>
#include <Xi18n.h>
#include <log.h>

/*State masks*/
#define STATE_NONE	0x0
#define STATE_SHIFT	0x1
#define STATE_CAPS	0x2
#define STATE_CTRL	0x4
#define STATE_ALT	0x8
#define STATE_NUM	0x10
#define STATE_SUPER	0x40
#define STATE_SCROLL	0x80
#define STATE_MOUSE	0x100

/*Types for platform hotkeys*/
typedef struct {
	KeySym sym;
	int state;
} TriggerKey;
typedef struct {
	TriggerKey* keys;
	unsigned int count;
} TriggerKeys;

extern TriggerKeys switch_keys;   //switch one IM to another
extern TriggerKeys trigger_keys;  //trigger one IM on/off

int EventHandler(IMForwardEventStruct* data); //Handle a key event

#endif
